'''
Created on 13 June 2011

@author: John
'''
#Imports
import os
import sqlite3 as sqlitedb

#Constants
DB_PATH = '.\db\CardBase_DB.db'

#Code
class Connect(object):

    def connect(self):
        try:
            self.conn = sqlitedb.connect(DB_PATH)
            self.cur = self.conn.cursor()
            return True
        except sqlitedb.Error as self.error:
            print self.error
            return False
    
    def commit_and_close(self):
        self.conn.commit()
        self.cur.close()
        self.conn.close()